package cn.zly.spring.beans.factory.support;

import cn.zly.spring.beans.factory.config.SingletonBeanRegistry;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhanglianyong
 * @date 2024/12/26
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

	private Map<String, Object> singletonObjects = new HashMap<>();


	@Override
	public Object getSingleton(String beanName) {

		return singletonObjects.get(beanName);
	}


	protected void addSingleton(String beanName, Object singletonObject) {
		singletonObjects.put(beanName, singletonObject);
	}
}
